import java.util.Arrays;
import java.util.Scanner;
class Solution {
        public static int[] findErrorNums(int[] nums) {
            //找到重复的数字
            int[] ret = new int[2];
            Arrays.sort(nums);

            int i = 0;
            for( i = 1;i < nums.length + 1;i++){
                int flag = 0;
                for(int j = 0;j < nums.length ;j++){
                    if(i == nums[j]){
                        flag = 1 ;
                        break;
                    }
                    else;
                }
                if(flag == 0){
                    ret[1] = i;
                }
            }
            for(int k = 0;k < nums.length - 1;k++){
                if(nums[k] == nums[k+1]){
                    ret[0] = nums[k];
                    break;
                }
            }
            return ret;
        }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] nums = new int[4];
        for (int i = 0; i < 4; i++) {
            nums[i] = sc.nextInt();
        }
        int[] ret = findErrorNums(nums);
        System.out.println(Arrays.toString(ret));
    }
    }